using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

namespace GateWay
{
    public class Program
    {
        public static void Main(string[] args)
        {
            CreateHostBuilder(args).Build().Run();
        }

        public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
                .ConfigureAppConfiguration(cfg_builder =>
                {
                    cfg_builder.AddJsonFile("appsettings.json");
                    cfg_builder.AddJsonFile("ocelot.json");
                })
                .ConfigureWebHostDefaults(webBuilder =>
                {
                    //webBuilder.UseKestrel(m=> {
                    //    m.Listen(IPAddress.Parse("192.168.101.105"), 50000);
                        
                    //});
                    webBuilder.UseUrls("http://192.168.101.105:50000");
                    webBuilder.UseStartup<Startup>();
                });
    }
}
